<template>
<el-container>
    <el-header class="mianbaoxie">
    <el-breadcrumb
              separator-class="el-icon-arrow-right"
              class="man-el"
            >
              <el-breadcrumb-item :to="{ path: '/thi' }"
                >第三方管理</el-breadcrumb-item
              >
              <el-breadcrumb-item>投保申请</el-breadcrumb-item>
            </el-breadcrumb>
    </el-header>
    <el-main>
        
            <table class="thad">
            <thead>
              <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>手机号</th>
                <th>车牌号</th>
                <th>申请时间</th>
               
              </tr>
            </thead>
            <tbody>
              <tr v-for="item in nowtableaut" :key="item.id">
                <td>{{ item.id }}</td>
                <td>{{ item.name }}</td>
                <td>{{ item.phoneNumber }}</td>
                <td>{{ item.carNumber }}</td>
                <td>{{ item.applicationTime }}</td>
               
              </tr>
            </tbody>
          </table>

          <el-col :span="8" :offset="8">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage4"
              :page-sizes="[10,20,30]"
              :page-size="pagesize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="nuerlist.length"
            >
            </el-pagination>
          </el-col>
    </el-main>
 </el-container>
</template>

<script>
export default {
 data() {
    return {
      currentPage4: 1, //当前显示第几页
      pagesize: 6, //一页显示6条
      input:'' , //搜索查询的输入框
      nuerlist: [
        {
          id: 1,
          name: "创世达公司",
          namedm: "创世达",
          tel: 1234567435,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 2,
          name: "创世达公司",
          namedm: "创世达1",
          tel: 1234567345,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 3,
          name: "创世达公司",
          namedm: "创世达2",
          tel: 123456723,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 4,
          name: "创世达公司",
          namedm: "创世达3",
          tel: 123456754,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 5,
          name: "创世达公司",
          namedm: "创世达4",
          tel: 123456734,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 6,
          name: "创世达公司",
          namedm: "创世达5",
          tel: 123456723,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 7,
          name: "创世达公司",
          namedm: "创世达6",
          tel: 12345677,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 8,
          name: "创世达公司",
          namedm: "创世达7",
          tel: 123456767,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 9,
          name: "创世达公司",
          namedm: "创世达8",
          tel: 123456715,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 10,
          name: "创世达公司",
          namedm: "创世达9",
          tel: 123456717,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 11,
          name: "创世达公司",
          namedm: "创世达12",
          tel: 123456716,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 12,
          name: "创世达公司",
          namedm: "创世达23",
          tel: 123456713,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 13,
          name: "创世达公司",
          namedm: "创世达15",
          tel: 123456714,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 14,
          name: "创世达公司",
          namedm: "创世达15",
          tel: 123456712,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 15,
          name: "创世达公司",
          namedm: "创世达15",
          tel: 123456711,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 16,
          name: "创世达公司",
          namedm: "创世达34",
          tel: 123456710,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 17,
          name: "创世达公司",
          namedm: "创世达67",
          tel: 23545679,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
        {
          id: 18,
          name: "创世达公司",
          namedm: "创世达",
          tel: 12345678,
          saubut: "是",
          dizhi: "成都市武汉区",
        },
      ],
    };
  },
   computed: {
    nowtableaut() {
      return (
        this.nuerlist.slice(
          (this.currentPage4 - 1) * this.pagesize,
          this.currentPage4 * this.pagesize
        ) || []
      );
    },
  },
  methods: {
     formData(now){
      const date = new Date(now)
      var y = date.getFullYear() // 年份
      var m = date.getMonth() + 1 // 月份，注意：js里的月要加1
      var d = date.getDate() // 日
      var h = date.getHours() // 小时
      var min = date.getMinutes() // 分钟
      var s = date.getSeconds() // 秒
	 // 返回值，根据自己需求调整，现在已经拿到了年月日时分秒了 
      return y + '-' + m + '-' + d + ' ' + h + ':' + min + ':' + s

     },
    onSubmit() {
      this.$router.push("/addinsurancecompany")
    },
    handleSizeChange(currentPage1) {
      this.pagesize = currentPage1;
      console.log(`每页 ${currentPage1} 条`);
    },
    handleCurrentChange(currentPage4) {
      this.currentPage4 = currentPage4;
      console.log(`当前页: ${currentPage4}`);
    },
    etc(){
        console.log(this.input);
     return   this.input==this.nuerlist.tel;

      
    }
  },
  created() {
     this.nuerlist=[]
    this.$axios({
      url:'/insuranceApplication/list',
      method:"POST"

    }).then(res=>{
      console.log(res.data);
 
      if(res.data.code==0){
        
         this.nuerlist=res.data.data
         this.nuerlist.forEach(item => {
             item.applicationTime=this.formData(item.applicationTime)
         });
      }
    })
  },
 
}
</script>

<style lang="less" scoped>
 .mianbaoxie{
  border-bottom: 1px solid rgb(68, 66, 66);
 
 }
  .man-el{
    height: 60px;
    line-height: 60px;
    font-size: 20px;
 }
 .shuruk{
    width: 300px;
    margin-right: 20px;
 }.el-icon-plus{
  width: 150px;
  margin-top: 20px;
 }
 .thad{
    width: 100%;
     text-align: center;
line-height: 50px;
 }
 
.thad th,
.thad td{
    border: 1px solid rgba(119, 117, 117, 0.192);
    border-left: 0px;
    border-right:0px;
    border-top:0px
}
</style>